﻿Imports Microsoft.Practices.EnterpriseLibrary.Data
Imports Crystal.CLL

Public Class DataAccess
    Public Shared Function CreateDataBase() As Microsoft.Practices.EnterpriseLibrary.Data.Database
        If Not CommonCLL.mstrConnectionstring.Equals(String.Empty) Then
            Return New Sql.SqlDatabase(DecriptConnectionString)
        End If
        Return Nothing
    End Function
    Public Shared Function DecriptConnectionString() As String
        Dim strDecryptedString As String = ""
        Dim connStr As String = CommonCLL.mstrConnectionstring
        If connStr.ToLower().IndexOf("database") <> -1 Then
            strDecryptedString = connStr
        Else
            strDecryptedString = EncDec.Decrypt(connStr, "")
        End If
        Return strDecryptedString
    End Function
End Class
